<template>
  <div class="container">	  
	<router-view class="main"></router-view>
    <Footer v-show="$route.path!=='/details'&&$route.path!=='/buy'&&$route.path!=='/search'&&$route.path!=='/buytwo'&&$route.path!=='/login'"></Footer>
  </div>
</template> 

<script>
  import Main from './components/Main';
  import Footer from './components/Footer';

  export default {
    components : {
      Main,
      Footer
    },
	mounted() {

		var app = JSON.parse(localStorage.getItem("good") || "{}");
		var bpp = JSON.parse(localStorage.getItem("buy") || "{}");
		function kong(app){
			for(var i in app){
				return true
			}
			return false
		}
		if(kong(app) == false){
			localStorage.setItem('good',JSON.stringify({}));
		}
		if(kong(bpp) == false){
			localStorage.setItem('buy',JSON.stringify({}));
		}
		// localStorage.setItem('good',JSON.stringify({}));
		// localStorage.setItem('buy',JSON.stringify({}));

		var appA = JSON.parse(localStorage.getItem("reg") || "{}")
		 function judge(appA){
		 　　for(var i in appA){
			 //如果不为空，则会执行到这一步，返回true
		 　　　　return true;
		 　　}
		　　 return false;
		 }
		 console.log(judge(appA))
		 if(judge(appA) === false){
			 localStorage.setItem("reg",JSON.stringify({"key":"value"}));
		 }

	}
  }
</script>
<style lang="scss">
    *{
        margin : 0;
        padding : 0;
    }
    body,html{
      height : 100%;
      font-family: Helvetica Neue,Helvetica,Arial,Microsoft Yahei,Hiragino Sans GB,Heiti SC,WenQuanYi Micro Hei,sans-serif;
      font-size: 14px;
      color: #333;
    }
    a{
      text-decoration: none;
    }
    .container{
      height : 100%;
      display : flex;
      flex-direction: column;
	  overflow: auto;
    }
	
</style>
